package com.yan.mvc.controller;

import com.yan.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class TestController {

    @Autowired
    AdminService adminService;

    @ResponseBody
    @RequestMapping("/send/array/three.html")
    public String testReceiveArrayThree(@RequestBody List<Integer> array){
        for (Integer integer : array) {
            System.out.println(integer);
        }
        return "success";
    }

    @RequestMapping("/test/ssm.html")
    public String TestSsm(Model model){
        model.addAttribute("admin","adminUser");
        return "target";
    }

}
